Axios.defaults.baseURL = project + '/onlineArchive/transfer/deputy';
let main = {
    el: "#app",
    data: function () {
        return {
            loading_1: false,
            loading_2: false,
            loading_3: false,
            loading_4: false,
            loading_5: false,
            archivalStatus: [],
            archivalType: [],
            incomingWay: [],
            activeName: 'first',
            spotCheckResultDialogVisible: false,
            spotCheckResultOptions: [],
            spotCheckResult: [],
            pendingTransferSearch: {
                pagination: {
                    pageNum: 1,
                    pageSize: 10,
                    total: 0,
                },
                applicationDate: [],
                loanTime: [],
                applicationNo: '',
                customerName: '',
                productName: '',
                incomingWay: '',
                insuredName: '',
                archivalType: '',
                archivalStatus: '',
                keyword: ''
            },
            pendingTransferList: [],
            transferToDivisionIds: [],
            storeSpotCheckingSearch: {
                pagination: {
                    pageNum: 1,
                    pageSize: 10,
                    total: 0,
                },
                applicationDate: [],
                loanTime: [],
                applicationNo: '',
                customerName: '',
                productName: '',
                incomingWay: '',
                insuredName: '',
                archivalType: '',
                archivalStatus: '',
                keyword: ''
            },
            storeSpotCheckingIds: [],
            storeSpotCheckingList: [],
            transferredDivisionSearch: {
                pagination: {
                    pageNum: 1,
                    pageSize: 10,
                    total: 0,
                },
                applicationDate: [],
                loanTime: [],
                applicationNo: '',
                customerName: '',
                productName: '',
                incomingWay: '',
                insuredName: '',
                archivalType: '',
                archivalStatus: '',
                keyword: ''
            },
            transferredDivisionList: [],
            divisionFallbackSearch: {
                pagination: {
                    pageNum: 1,
                    pageSize: 10,
                    total: 0,
                },
                applicationDate: [],
                loanTime: [],
                applicationNo: '',
                customerName: '',
                productName: '',
                incomingWay: '',
                insuredName: '',
                archivalType: '',
                archivalStatus: '',
                keyword: ''
            },
            divisionFallbackList: [],
            divisionFallbackIds: [],
            deputyTobeSortedSearch: {
                pagination: {
                    pageNum: 1,
                    pageSize: 10,
                    total: 0,
                },
                isSimple: true,
                applicationDate: [],
                loanTime: [],
                applicationNo: '',
                customerName: '',
                productName: '',
                incomingWay: '',
                insuredName: '',
                archivalType: '',
                archivalStatus: '',
                keyword: ''
            },
            customerTobeSortedList: [],
            archivePageNumberDialogVisible: false,
            toBeSortedDistributionIds: [],
            searchArea: {
                pendingTransferTable: {
                    height: 40,
                    isSimple: true
                },
                storeSpotCheckingTable: {
                    height: 40,
                    isSimple: true
                },
                transferredDivisionTable: {
                    height: 40,
                    isSimple: true
                },
                divisionFallbackTable: {
                    height: 40,
                    isSimple: true
                },
                toBeSortedTable: {
                    height: 40,
                    isSimple: true
                }
            },
            dialogAddgsVisible: false,
            title: '',
            options: [{}],
            customers: '',
        }
    },
    beforeMount: function () {
        this.init();
    },
    computed: {
        // 计算属性的 getter
        tableHeight: function () {
            let height = window.parent.document.getElementById('content-main').clientHeight;
            let that = this;
            return {
                pendingTransferTable: height - that.searchArea.pendingTransferTable.height - 125,
                storeSpotCheckingTable: height - that.searchArea.storeSpotCheckingTable.height - 125,
                transferredDivisionTable: height - that.searchArea.transferredDivisionTable.height - 125,
                divisionFallbackTable: height - that.searchArea.divisionFallbackTable.height - 125,
                toBeSortedTable: height - that.searchArea.toBeSortedTable.height - 125
            }
        }
    },
    methods: {
        //未整理---分配---客服选择下拉框
        addGsForm: function () {
            let that = this;
            if (that.toBeSortedDistributionIds.length == 0) {
                noticeWarning(that, '还未选择档案');
                return;
            }
            Axios({
                method: 'post',
                url: '/search/cusomers',
            })
                .then(function (response) {
                    that.options = response.data
                    that.dialogAddgsVisible = true;
                    that.title = "请选择客服"
                })
                .catch(function (error) {
                });

        },
        closeDialogAddgsVisible: function () {
        },
        saveAddForm: function () {
            let that = this;
            Axios({
                url: '/distribution?customerId=' + that.customers,
                data: that.toBeSortedDistributionIds,
                method: 'post',
            }).then(function (response) {
                if (response.code != 0) {
                    noticeFailure(that);
                    return;
                }
                that.initToBeSortedPageList();
                that.dialogAddgsVisible = false;
                noticeSuccess(that);
                console.log(that.customers)
            }).catch(function (error) {
                noticeDataRequestFailure(that);
            })

        },
        /**
         * 重置查询条件
         * @param table
         */
        resetSearch: function (table) {
            if (table == 'pendingTransferTable') {
                this.pendingTransferSearch = {
                    pagination: {
                        pageNum: 1,
                        pageSize: 10,
                        total: 0,
                    },
                    applicationDate: [],
                    loanTime: [],
                    applicationNo: '',
                    customerName: '',
                    productName: '',
                    incomingWay: '',
                    insuredName: '',
                    archivalType: '',
                    archivalStatus: '',
                    keyword: ''
                };
                this.initPendingTransferPageList();
                return;
            } else if (table == 'storeSpotCheckingTable') {
                this.storeSpotCheckingSearch = {
                    pagination: {
                        pageNum: 1,
                        pageSize: 10,
                        total: 0,
                    },
                    isSimple: true,
                    applicationDate: [],
                    loanTime: [],
                    applicationNo: '',
                    customerName: '',
                    productName: '',
                    incomingWay: '',
                    insuredName: '',
                    archivalType: '',
                    archivalStatus: '',
                    transferDeputyTime: [],
                    keyword: ''
                };
                this.initStoreSpotCheckingPageList();
                return;
            } else if (table == 'transferredDivisionTable') {
                this.transferredDivisionSearch = {
                    pagination: {
                        pageNum: 1,
                        pageSize: 10,
                        total: 0,
                    },
                    isSimple: true,
                    applicationDate: [],
                    loanTime: [],
                    applicationNo: '',
                    customerName: '',
                    productName: '',
                    incomingWay: '',
                    insuredName: '',
                    archivalType: '',
                    archivalStatus: '',
                    transferDeputyTime: [],
                    keyword: ''
                };
                this.initTransferredDivisionSearchPageList();
                return;
            } else if (table == 'divisionFallbackTable') {
                this.divisionFallbackSearch = {
                    pagination: {
                        pageNum: 1,
                        pageSize: 10,
                        total: 0,
                    },
                    isSimple: true,
                    applicationDate: [],
                    loanTime: [],
                    applicationNo: '',
                    customerName: '',
                    productName: '',
                    incomingWay: '',
                    insuredName: '',
                    archivalType: '',
                    archivalStatus: '',
                    transferDeputyTime: [],
                    keyword: ''
                };
                this.initDivisionFallbackPageList();
                return;
            } else if (table == 'toBeSortedTable') {
                this.deputyTobeSortedSearch = {
                    pagination: {
                        pageNum: 1,
                        pageSize: 10,
                        total: 0,
                    },
                    isSimple: true,
                    applicationDate: [],
                    loanTime: [],
                    applicationNo: '',
                    customerName: '',
                    productName: '',
                    incomingWay: '',
                    insuredName: '',
                    archivalType: '',
                    archivalStatus: '',
                    transferDeputyTime: [],
                    keyword: ''
                };
                this.initToBeSortedPageList();
                return;
            } else {
                return;
            }
        },
        /**
         * 展开  收缩查询区域
         * @param table
         */
        showclick: function (table) {
            this.searchArea[table].isSimple = !this.searchArea[table].isSimple;
            let that = this;
            setTimeout(function () {
                that.searchArea[table].height = window.document.getElementById(table).clientHeight;
            }, 500)
        },
        /**
         * 页面渲染时加载数据
         */
        init:function(){
            let that = this;
            axios.all([getArchivalStatusList(),getArchivalTypeList(),getIncomingWayList(),getSpotCheckResultList()])
                .then(axios.spread(function (archivalStatus,archivalType,incomingWay,spotCheckResult) {
                    that.archivalStatus = archivalStatus.data.data;
                    that.archivalType = archivalType.data.data;
                    that.incomingWay = incomingWay.data.data;
                    that.spotCheckResultOptions = spotCheckResult.data.data;
                })).then(function () {
                that.initPendingTransferPageList();
            });
        },
        getStoreByDivision(){
           return axios.get('');
        },
        /**
         * 副理回退
         */
        fallback: function () {
            if (this.storeSpotCheckingIds.length == 0) {
                noticeWarning(this, '还未选择档案');
                return;
            }
            if (this.storeSpotCheckingIds.length > 1) {
                noticeWarning(this, '每次只能选择一个档案回退');
                return;
            }
            let that = this;
            this.$prompt('请填写回退原因', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消'
            }).then(function (data) {
                Axios({
                    method: 'post',
                    url: '/storeSpotChecking/fallback',
                    data: {
                        id: that.storeSpotCheckingIds[0],
                        reason: data.value
                    },
                    transformRequest: [function (data) {
                        // 对 data 进行任意转换处理
                        return Qs.stringify(data)
                    }],
                })
                    .then(function (response) {
                        if (response.code != 0) {
                            noticeDataRequestFailure(that);
                            return;
                        }
                        noticeSuccess(that);
                        that.initStoreSpotCheckingPageList();
                    })
                    .catch(function (error) {
                        noticeFailure(that);
                    });
            })
        },
        /**
         *获取副理待移交分部数据
         */
        getPendingTransferPageList: function () {
            let that = this;
            that.loading_1 = true;
            Axios({
                method: 'post',
                url: '/pendingTransfer/pageList',
                data: that.pendingTransferSearch
            })
                .then(function (response) {
                    that.loading_1 = false;
                    if (response.code != 0) {
                        noticeDataRequestFailure(that);
                        return;
                    }
                    that.pendingTransferList = response.data.list;
                    that.pendingTransferSearch.pagination.total = response.data.total;

                })
                .catch(function (error) {
                    noticeFailure(that);
                    that.loading_1 = false;
                });
        },
        /**
         * 初始化副理待移交分部数据列表，（加载第一页数据）
         */
        initPendingTransferPageList: function () {
            this.pendingTransferTablePageNumChange(1);
        },
        /**
         * 副理待移交分部列表 ，翻页，跳页
         * @param pageNum
         */
        pendingTransferTablePageNumChange: function (pageNum) {
            this.pendingTransferSearch.pagination.pageNum = pageNum;
            this.getPendingTransferPageList();
        },
        /**
         * 待移交分部列表，每页条数改变时触发
         * @param pageSize
         */
        pendingTransferTablePageSizeChange: function (pageSize) {
            this.pendingTransferSearch.pagination.pageNum = 1;
            this.pendingTransferSearch.pagination.pageSize = pageSize;
            this.getPendingTransferPageList();
        },
        /**
         * 待移交分部数据表格复选框是否可选(如果正在抽检，则不可选）
         * @param row
         * @param index
         */
        pendingTransferTableIsOptional: function (row, index) {
            if (row.storeInSpotChecking) {
                return false;
            } else {
                return true;
            }
        },
        /**
         * 副理待移交到分部数据表格复选框选择数据
         * @param selection
         */
        pendingTransferTableSelectionChange: function (selection) {
            this.transferToDivisionIds = selection.map(function (x) {
                return x.id
            });
        },
        /**
         * 获取待整理数据（副理获取未整理的数据）
         */
        getToBeSortedPageList: function () {
            let that = this;
            that.loading_1 = true;
            Axios({
                method: 'post',
                url: '/toBeSorted/pageList',
                data: that.deputyTobeSortedSearch
            })
                .then(function (response) {
                    that.loading_1 = false;
                    if (response.code != 0) {
                        noticeDataRequestFailure(that);
                        return;
                    }
                    that.customerTobeSortedList = response.data.list;
                    that.deputyTobeSortedSearch.pagination.total = response.data.total;
                })
                .catch(function (error) {
                    noticeFailure(that);
                    that.loading_1 = false;
                });
        },
        /**
         * 未整理数据表格复选框选择数据
         * @param selection
         */
        toBeSortedTableSelectionChange: function (selection) {
            this.toBeSortedDistributionIds = selection.map(function (x) {
                return x.originalIncomingId
            });
        },
        /**
         * 未整理数据分配
         */
        toBeSortedDistribution:function(){
            let that = this;
            if (that.toBeSortedDistributionIds.length == 0){
                noticeWarning(that,'还未选择档案');
                return;
            }
            this.$prompt('请输入客服id：', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'info'
            }).then(function({ value }) {
                Axios({
                    url:'/distribution?customerId='+value,
                    data:that.toBeSortedDistributionIds,
                    method:'post',
                }).then(function (response) {
                    if (response.code != 0){
                        noticeFailure(that);
                        return;
                    }
                    that.initToBeSortedPageList();
                    noticeSuccess(that);
                }).catch(function (error) {
                    noticeDataRequestFailure(that);
                })
            });
        },
        /**
         * 初始化待整理数据列表，（加载第一页数据）
         */
        initToBeSortedPageList: function () {
            this.toBeSortedTablePageNumChange(1);
        },
        /**
         * 待整理列表 ，页码改变时触发
         * @param pageNum
         */
        toBeSortedTablePageNumChange: function (pageNum) {
            this.deputyTobeSortedSearch.pagination.pageNum = pageNum;
            this.getToBeSortedPageList();
        },
        /**
         * 待整理数据列表，每页条数改变时触发
         * @param pageSize
         */
        toBeSortedTablePageSizeChange: function (pageSize) {
            this.deputyTobeSortedSearch.pagination.pageNum = 1;
            this.deputyTobeSortedSearch.pagination.pageSize = pageSize;
            this.getToBeSortedPageList();
        },

        /**
         * 未整理数据分配
         */
        toBeSortedDistribution: function () {
            let that = this;
            if (that.toBeSortedDistributionIds.length == 0) {
                noticeWarning(that, '还未选择档案');
                return;
            }
            this.$prompt('请输入客服id：', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'info'
            }).then(function ({value}) {
                Axios({
                    url: '/distribution?customerId=' + value,
                    data: that.toBeSortedDistributionIds,
                    method: 'post',
                }).then(function (response) {
                    if (response.code != 0) {
                        noticeFailure(that);
                        return;
                    }
                    that.initToBeSortedPageList();
                    noticeSuccess(that);
                }).catch(function (error) {
                    noticeDataRequestFailure(that);
                })
            });
        },
        /**
         * 副理移交档案到分部
         */
        transferToDivision: function () {
            let that = this;
            if (that.transferToDivisionIds.length == 0) {
                noticeWarning(that, '还未选择档案');
                return;
            }
            this.$confirm('本次移交档案：' + that.transferToDivisionIds.length + '份，请与实物档案核对是否一致！', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'info'
            }).then(function () {
                Axios({
                    url: '/pendingTransfer/transfer',
                    data: that.transferToDivisionIds,
                    method: 'post',
                }).then(function (response) {
                    if (response.code != 0) {
                        noticeFailure(that);
                        return;
                    }
                    that.initPendingTransferPageList();
                    noticeSuccess(that);
                }).catch(function (error) {
                    noticeDataRequestFailure(that);
                })
            });
        },
        /**
         * 副理移交  分部回退记录到分部  按钮
         */
        transferToDivisionFallBack: function () {
            let that = this;
            if (that.divisionFallbackIds.length == 0) {
                noticeWarning(that, '还未选择档案');
                return;
            }
            this.$confirm('本次移交档案：' + that.divisionFallbackIds.length + '份，请与实物档案核对是否一致！', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'info'
            }).then(function () {
                Axios({
                    url: '/pendingTransfer/transfer',
                    data: that.divisionFallbackIds,
                    method: 'post',
                }).then(function (response) {
                    if (response.code != 0) {
                        noticeFailure(that);
                        return;
                    }
                    that.initDivisionFallbackPageList();
                    noticeSuccess(that);
                }).catch(function (error) {
                    noticeDataRequestFailure(that);
                })
            });
        },
        divisionFallbackTableSelectionChange: function (selection) {
            this.divisionFallbackIds = selection.map(function (x) {
                return x.id
            });
        },
        /**
         * 副理点击抽检按钮
         */
        storeSpotChecking: function () {
            let that = this;
            if (that.transferToDivisionIds.length == 0) {
                noticeWarning(that, '还未选择档案');
                return;
            }
            Axios({
                url: '/pendingTransfer/storeSpotChecking',
                data: that.transferToDivisionIds,
                method: 'post',
            }).then(function (response) {
                if (response.code != 0) {
                    noticeFailure(that);
                    return;
                }
                that.getPendingTransferPageList();
                noticeSuccess(that);
            }).catch(function (error) {
                noticeDataRequestFailure(that);
            })
        },
        /**
         *获取门店档案抽检数据
         */
        getStoreSpotCheckingPageList: function () {
            let that = this;
            that.loading_2 = true;
            Axios({
                method: 'post',
                url: '/storeSpotChecking/pageList',
                data: that.storeSpotCheckingSearch
            })
                .then(function (response) {
                    that.loading_2 = false;
                    if (response.code != 0) {
                        noticeDataRequestFailure(that);
                        return;
                    }
                    that.storeSpotCheckingList = response.data.list;
                    that.storeSpotCheckingSearch.pagination.total = response.data.total;

                })
                .catch(function (error) {
                    noticeFailure(that);
                    that.loading_2 = false;
                });
        },
        /**
         * 初始化门店档案抽检数据列表，（加载第一页数据）
         */
        initStoreSpotCheckingPageList: function () {
            this.storeSpotCheckingTablePageNumChange(1);
        },
        /**
         * 门店档案抽检列表 ，翻页，跳页
         * @param pageNum
         */
        storeSpotCheckingTablePageNumChange: function (pageNum) {
            this.storeSpotCheckingSearch.pagination.pageNum = pageNum;
            this.getStoreSpotCheckingPageList();
        },
        /**
         * 门店档案抽检据列表，每页条数改变时触发
         * @param pageSize
         */
        storeSpotCheckingTablePageSizeChange: function (pageSize) {
            this.storeSpotCheckingSearch.pagination.pageNum = 1;
            this.storeSpotCheckingSearch.pagination.pageSize = pageSize;
            this.getStoreSpotCheckingPageList();
        },
        /**
         *获取已移交分部数据列表
         */
        getTransferredDivisionPageList: function () {
            let that = this;
            that.loading_3 = true;
            Axios({
                method: 'post',
                url: '/transferredDivision/pageList',
                data: that.transferredDivisionSearch
            })
                .then(function (response) {
                    that.loading_3 = false;
                    if (response.code != 0) {
                        noticeDataRequestFailure(that);
                        return;
                    }
                    that.transferredDivisionList = response.data.list;
                    that.transferredDivisionSearch.pagination.total = response.data.total;
                })
                .catch(function (error) {
                    noticeFailure(that);
                    that.loading_3 = false;
                });
        },
        /**
         * 初始化已移交分部数据列表，（加载第一页数据）
         */
        initTransferredDivisionSearchPageList: function () {
            this.transferredDivisionTablePageNumChange(1);
        },
        /**
         * 副理已移交分部列表 ，翻页，跳页
         * @param pageNum
         */
        transferredDivisionTablePageNumChange: function (pageNum) {
            this.transferredDivisionSearch.pagination.pageNum = pageNum;
            this.getTransferredDivisionPageList();
        },
        /**
         * 已移交分部数据列表，每页条数改变时触发
         * @param pageSize
         */
        transferredDivisionTablePageSizeChange: function (pageSize) {
            this.transferredDivisionSearch.pagination.pageNum = 1;
            this.transferredDivisionSearch.pagination.pageSize = pageSize;
            this.getTransferredDivisionPageList();
        },
        /**
         * 点击抽检结果按钮的操作
         */
        handleSpotCheckResult: function () {
            if (this.storeSpotCheckingIds.length == 0) {
                noticeWarning(this, '还未选择档案');
                return;
            }
            this.spotCheckResult = [];
            this.spotCheckResultDialogVisible = true;
        },
        /**
         * 门店档案抽检列表选择项改变时触发
         * @param selection
         */
        storeSpotCheckingTableSelectionChange: function (selection) {
            this.storeSpotCheckingIds = selection.map(function (x) {
                return x.id
            });
        },
        /**
         * 保存门店档案抽检结果
         */
        saveStoreSpotCheckingResult: function () {
            if (this.spotCheckResult.length == 0) {
                noticeWarning(this, '未选择抽检结果');
                return;
            }
            let that = this;
            Axios({
                method: 'post',
                url: '/storeSpotChecking/saveStoreSpotCheckingResult',
                data: {
                    ids: that.storeSpotCheckingIds.join(","),
                    results: that.spotCheckResult.join(";")
                },
                transformRequest: [function (data) {
                    // 对 data 进行任意转换处理
                    return Qs.stringify(data)
                }],
            })
                .then(function (response) {
                    if (response.code != 0) {
                        noticeDataRequestFailure(that);
                        return;
                    }
                    that.spotCheckResultDialogVisible = false;
                    noticeSuccess(that);
                    that.initStoreSpotCheckingPageList();
                })
                .catch(function (error) {
                    noticeFailure(that);
                });
        },
        /**
         * 门店档案抽检数据列表复选框是否可选择
         */
        storeSpotCheckingTableIsOptional: function (row, index) {
            if (row.archivalStatus == 2) {
                return false;
            } else {
                return true;
            }
        },
        /**
         * 点击通过按钮
         */
        pass: function () {
            let that = this;
            if (this.storeSpotCheckingIds.length == 0) {
                noticeWarning(that, '还未选择档案');
                return;
            }

            this.$confirm('请确认抽检合格', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'info'
            }).then(function () {
                Axios({
                    url: '/storeSpotChecking/pass',
                    data: that.storeSpotCheckingIds,
                    method: 'post',
                }).then(function (response) {
                    if (response.code != 0) {
                        noticeFailure(that);
                        return;
                    }
                    that.initStoreSpotCheckingPageList();
                    noticeSuccess(that);
                }).catch(function (error) {
                    noticeDataRequestFailure(that);
                })
            });
        },
        /**
         *获取分部回退数据
         */
        getDivisionFallbackPageList: function () {
            let that = this;
            that.loading_4 = true;
            Axios({
                method: 'post',
                url: '/divisionFallback/pageList',
                data: that.divisionFallbackSearch
            })
                .then(function (response) {
                    that.loading_4 = false;
                    if (response.code != 0) {
                        noticeDataRequestFailure(that);
                        return;
                    }
                    that.divisionFallbackList = response.data.list;
                    that.divisionFallbackSearch.pagination.total = response.data.total;
                })
                .catch(function (error) {
                    noticeFailure(that);
                    that.loading_4 = false;
                });
        },
        /**
         * 初始化分部回退数据列表，（加载第一页数据）
         */
        initDivisionFallbackPageList: function () {
            this.getDivisionFallbackPageList(1);
        },
        /**
         * 分部回退列表 ，翻页，跳页
         * @param pageNum
         */
        divisionFallbackTablePageNumChange: function (pageNum) {
            this.divisionFallbackSearch.pagination.pageNum = pageNum;
            this.getDivisionFallbackPageList();
        },
        /**
         * 分部回退数据列表，每页条数改变时触发
         * @param pageSize
         */
        divisionFallbackTablePageSizeChange: function (pageSize) {
            this.divisionFallbackSearch.pagination.pageNum = 1;
            this.divisionFallbackSearch.pagination.pageSize = pageSize;
            this.getDivisionFallbackPageList();
        },
        /**
         * 点击tab页切换时执行
         * @param tab
         */
        tabClick: function (tab) {
            if (tab.name == 'first') {
                this.initPendingTransferPageList();
                return;
            }
            if (tab.name == 'second') {
                this.initStoreSpotCheckingPageList();
                return;
            }
            if (tab.name == 'third') {
                this.initTransferredDivisionSearchPageList();
                return;
            }
            if (tab.name == 'fourth') {
                this.initDivisionFallbackPageList();
                return;
            }
            if (tab.name == 'fifth') {
                this.initToBeSortedPageList();
                return;
            }
        },
        /**
         * 日期列格式化
         * @param row
         * @param column
         * @param cellValue
         * @param index
         */
        dateTimeFormatter: function (row, column, cellValue, index) {
            return dateFormatter(cellValue);
        },
        /**
         * 是否格式化
         * @param row
         * @param column
         * @param cellValue
         * @param index
         */
        booleanFormatter: function (row, column, cellValue, index) {
            return booleanFormatter(cellValue);
        },
        /**
         * 档案状态格式化
         * @param row
         * @param column
         * @param cellValue
         * @param index
         */
        archivalStatusFormatter: function (row, column, cellValue, index) {
            for (let i = 0; i < this.archivalStatus.length; i++) {
                if (this.archivalStatus[i].code == cellValue) {
                    return this.archivalStatus[i].description;
                }
            }
            return "";
        },
        /**
         * 档案类型格式化
         * @param row
         * @param column
         * @param cellValue
         * @param index
         * @returns {string|*}
         */
        archivalTypeFormatter: function (row, column, cellValue, index) {
            for (let i = 0; i < this.archivalType.length; i++) {
                if (this.archivalType[i].code == cellValue) {
                    return this.archivalType[i].value;
                }
            }
            return "";
        },
        /**
         * 进件方式格式化
         * @param row
         * @param column
         * @param cellValue
         * @param index
         * @returns {string|*}
         */
        incomingWayFormatter: function (row, column, cellValue, index) {
            for (let i = 0; i < this.incomingWay.length; i++) {
                if (this.incomingWay[i].code == cellValue) {
                    return this.incomingWay[i].value;
                }
            }
            return "";
        },
    }
}
new Vue(main);